<template>
  <div class="collectidzero">
    <div id="shoucang0" class="fa fa-user fa-lg">收藏套餐信息</div>
    <div id="textbody">
      <div v-for="(val,key) in menuinf" id="textimg">
        <img :src="getcollectpic(menuinf[key].menuPic)" alt />
        <!-- <div id='textbackground'></div> -->
        <router-link
          :to="'/index/top/mealId/' + menuinf[key].mealId"
          id="texttext"
        >{{menuinf[key].menuName}}</router-link>
        <!-- <div id='texttext'>{{menuinf[key].menuName}}</div> -->
      </div>
      <!-- <div v-for="index in menuinflength" id="textdel">
        <button>套餐收藏{{index}}</button>
      </div> -->
      <hr>
      <p id="textbottom">暂无别的收藏，已最底部！！！</p>
    </div>
  </div>
</template>
<script>
export default {
  data() {
    return {
      menuinf: [],
      menuinflength: ""
    };
  },
  created() {
    this.$axios
      .get("http://localhost:3000/chat/collect0")
      .then(res => {
        this.menuinf = res.data.data;
        console.log(this.menuinf)
        this.menuinflength = res.data.data.length / 3;
        // console.log(res.data.data.length)
        console.log(this.menuinflength);
        console.log(res.data.data)
      })
      .catch(err => {
        console.log("错误信息：", err);
      });
  },
  methods: {
    getcollectpic(collectpic) {
      return require("../assets/images/" + collectpic);
    }
  }
};
</script>
<style lang="css" scoped>
.collectidzero {
  width: 60%;
  height: 100%;
}

#shoucang0 {
  margin-top:10px;
  width: 900px;
  height: 50px;
  border-radius: 5px 5px 0 0;
  background: linear-gradient(45deg, rgb(160, 191, 124), rgb(255, 255, 255))
    fixed;
  line-height: 50px;
  font-size: 22px;
  padding-left: 40px;
}
#textbody {
  width: 900px;
  border: 1px solid #ccc;
  float: left;
}

#textimg {
  margin-left: 60px;
  margin-top: 30px;
  width: 200px;
  height: 250px;
  float: left;
  /* border:1px solid red; */
}
#textbody img {
  width: 200px;
  height: 200px;
  float: left;
  border-radius: 5px;
  position: relative;
}
#textimg img:hover{
  width: 200px;
  height: 200px;
  border:1px solid #ccc;
  box-shadow: 2px 2px 5px #ccc;
}

#texttext {
  float: left;
  width: 200px;
  height: 45px;
  line-height: 45px;
  /* border: 1px solid black; */
  padding-left: 60px;
  /* padding-top:30px; */
}
#textdel {
  margin-left: 60px;
  margin-top: 30px;
  height: 250px;
  /* border: 1px solid red; */
}
#textdel button {
  width: 80px;
  height: 40px;
  border: 1px solid rgb(255, 255, 255);
  border-radius: 5px;
  background-color: rgb(160, 191, 124);
  color: white;
  margin-top:160px;
  margin-left: 10px;
}

#textbottom {
  width: 900px;
  float: left;
  text-align: center;
}
</style>